<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="ProductBacklogEntry.aspx.cs" Inherits="ProductBacklogEntry" Title="Tackle - Product Backlog Entry"%>
<%@ MasterType VirtualPath="~/MasterPage.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentHolder" Runat="Server">
    <span style="font-size: 10pt; font-family: Verdana"><strong>Product Backlog Entry</strong><br />
        <br />
        <span style="font-size: 8pt">
        This page contains the data
        entry for a product's backlog items.
        <br />
        </span>
        <asp:Label ID="lblNoProduct" runat="server" Font-Names="Verdana" Font-Size="X-Small"
            ForeColor="Red" Text="No product is registered for this group."></asp:Label>
        <br />
        <asp:UpdatePanel runat="server" ID="UPGridView" UpdateMode="Conditional">
        <ContentTemplate>
        <asp:Panel ID="pnlEntry" runat="server">
        <table cellpadding="4" cellspacing="0" width="98%">
            <tr>
                <td bgcolor="#e3eaeb" style="border-top: silver 1px ridge; border-left: silver 1px ridge; border-bottom: silver 1px ridge;" width="33%">
                    <span style="font-size: x-small">
                        Product: </span>
        <asp:DropDownList ID="dlProducts" runat="server" DataSourceID="dsProducts" DataTextField="ProductName"
            DataValueField="ProductID" AutoPostBack="True" Font-Names="Verdana" Font-Size="X-Small" OnDataBound="dlProducts_DataBound" OnSelectedIndexChanged="dlProducts_SelectedIndexChanged">
        </asp:DropDownList>
                    <asp:ImageButton ID="ibtnRefresh" runat="server" ImageUrl="~/Images/Refresh.gif"
                        OnClick="ibtnRefresh_Click" ToolTip="Click to Refresh the Product Backlog" style="vertical-align: middle" /></td>
                <td bgcolor="#e3eaeb" style="border-top: silver 1px ridge; width: 150px; border-bottom: silver 1px ridge">
                    <span style="font-size: x-small">State: </span>
                    <asp:DropDownList ID="dlShowComplete" runat="server" Font-Names="Verdana" Font-Size="X-Small" AutoPostBack="True" OnSelectedIndexChanged="dlShowComplete_SelectedIndexChanged" EnableViewState="True">
                        <asp:ListItem Value="0">Active</asp:ListItem>
                        <asp:ListItem Value="1">Completed</asp:ListItem>
                        <asp:ListItem Value="2">All</asp:ListItem>
                    </asp:DropDownList></td>
                <td bgcolor="#e3eaeb" style="border-top: silver 1px ridge; width: 150px; border-bottom: silver 1px ridge">
                    <span style="font-size: x-small">Page Size: </span>
                    <asp:DropDownList ID="dlPageSize"
                        runat="server" AutoPostBack="True" Font-Names="Verdana" Font-Size="X-Small" OnSelectedIndexChanged="dlPageSize_SelectedIndexChanged">
                        <asp:ListItem>10</asp:ListItem>
                        <asp:ListItem>25</asp:ListItem>
                        <asp:ListItem>50</asp:ListItem>
                        <asp:ListItem>100</asp:ListItem>
                        <asp:ListItem>All</asp:ListItem>
                    </asp:DropDownList></td>
                <td bgcolor="#e3eaeb" style="border-right: silver 1px ridge; border-top: silver 1px ridge;
                    border-bottom: silver 1px ridge; text-align: right">
                    <span style="font-size: x-small"></span>&nbsp;<asp:Button ID="btnNewEntry" runat="server" Font-Names="Verdana" Font-Size="X-Small"
        OnClick="btnNewEntry_Click" Text="New Backlog Entry" /></td>
            </tr>
            <tr>
                <td colspan="4">
    <asp:GridView ID="gvBacklogEntry" runat="server" AllowSorting="True" AutoGenerateColumns="False"
        CellPadding="4" DataKeyNames="MasterBacklogID" DataSourceID="dsBacklogEntry"
        ForeColor="#333333" GridLines="None" AllowPaging="True" Font-Names="Verdana" Font-Size="X-Small" OnRowDeleting="gvBacklogEntry_RowDeleting" Width="100%" OnPreRender="gvBacklogEntry_PreRender" 
        OnRowUpdating="gvBacklogEntry_RowUpdating" OnRowDataBound="gvBacklogEntry_RowDataBound" OnRowCancelingEdit="gvBacklogEntry_RowCancelingEdit" OnRowEditing="gvBacklogEntry_RowEditing">
        <FooterStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <Columns>
            <asp:BoundField DataField="MasterBacklogID" HeaderText="ID" InsertVisible="False"
                ReadOnly="True" SortExpression="MasterBacklogID" />
            <asp:TemplateField HeaderText="Product" SortExpression="ProductName" Visible="False">
                <EditItemTemplate>
                    <asp:DropDownList ID="ddProductList" runat="server" DataSourceID="dsProducts" DataTextField="ProductName"
                        DataValueField="ProductID" Font-Names="Verdana" Font-Size="X-Small" SelectedValue='<%# Bind("fProductID") %>'>
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("ProductName") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Customer Scenario" SortExpression="CustomerScenario"
                Visible="False">
                <EditItemTemplate>
                    <asp:TextBox ID="tbCustScen" runat="server" Text='<%# Bind("CustomerScenario") %>' Font-Names="Verdana" Font-Size="X-Small" MaxLength="255" ToolTip="The customer scenario field can be used to identify which customer requirements are met by this feature." Width="90%"></asp:TextBox><asp:RequiredFieldValidator
                        ID="rfvCustScen" runat="server" ControlToValidate="tbCustScen" ErrorMessage="*?" Font-Names="Verdana"
                        Font-Size="Small" ForeColor="LightCoral" ToolTip="This field must contain a valid value." Enabled='<%# Eval("CScenEditable") %>'></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label7" runat="server" Text='<%# Bind("CustomerScenario") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Feature" SortExpression="Feature">
                <EditItemTemplate>
                    <asp:TextBox ID="tbFeatureCtrl" runat="server" Text='<%# Bind("Feature") %>' Font-Names="Verdana" Font-Size="X-Small" MaxLength="255" ToolTip="The name of the feature or deliverable" Width="98%" Height="36px" TextMode="MultiLine"></asp:TextBox><br />
                    <asp:RequiredFieldValidator
                        ID="rfv1" runat="server" ControlToValidate="tbFeatureCtrl" ErrorMessage="*?" ForeColor="LightCoral" Font-Names="Verdana"
                        Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:CustomValidator
                            ID="cvalidFeature" runat="server" ControlToValidate="tbFeatureCtrl" ErrorMessage="* 255 max."
                            ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate" ToolTip="255"></asp:CustomValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("Feature") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Activity" SortExpression="Activity">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Activity") %>' Font-Names="Verdana" Font-Size="X-Small" MaxLength="50" ToolTip="The type of activity of work. Development, PM, Test etc." Width="90%"></asp:TextBox><asp:RequiredFieldValidator
                        ID="rfv2" runat="server" ControlToValidate="TextBox2" ErrorMessage="*?" ForeColor="LightCoral" Font-Names="Verdana"
                        Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("Activity") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Description" SortExpression="Description">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Description") %>' Font-Names="Verdana" Font-Size="X-Small" MaxLength="2048" Height="36px" TextMode="MultiLine" ToolTip='The description that clearly explains the work to be completed. Use "Task:" to predefine a task for the sprint backlog. Optional "[<owner>/<hours>]"can be used to predefine owner and hours of a task.' Width="98%"></asp:TextBox><br />
                    <asp:RequiredFieldValidator ID="rfv3" runat="server" ControlToValidate="TextBox3"
                        ErrorMessage="*?" Font-Names="Verdana" Font-Size="Small" ToolTip="This field must contain a valid value." ForeColor="LightCoral"></asp:RequiredFieldValidator><asp:CustomValidator
                            ID="cvalidDesc" runat="server" ControlToValidate="TextBox3" ErrorMessage="* 2048 max."
                            ForeColor="LightCoral" OnServerValidate="CustValMLMaxLength_ServerValidate" ToolTip="2048"></asp:CustomValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="lblDescription" runat="server" Text='<%# Bind("Description") %>' OnPreRender="lblDescription_PreRender"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Priority" SortExpression="ProductPriority">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("ProductPriority") %>' Font-Names="Verdana" Font-Size="X-Small" MaxLength="3" OnPreRender="SetupOnFocus_PreRender" ToolTip="The priority for this feature." Width="30px"></asp:TextBox><asp:RequiredFieldValidator
                        ID="rfv6" runat="server" ControlToValidate="TextBox6" ErrorMessage="*?" Font-Names="Verdana"
                        Font-Size="Small" ForeColor="LightCoral" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                            ID="rv6" runat="server" ControlToValidate="TextBox6" ErrorMessage="*#" Font-Names="Verdana"
                            Font-Size="Small" ForeColor="LightCoral" MaximumValue="10000" MinimumValue="0"
                            ToolTip="This field must contain a number between 0 and 10000" Type="Double"></asp:RangeValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label6" runat="server" Text='<%# Bind("ProductPriority") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Product Rank" SortExpression="ProductRank">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("ProductRank") %>' Font-Names="Verdana" Font-Size="X-Small" ToolTip="The feature or deliverables priority in the product" Width="30px" OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator
                        ID="rfv4" runat="server" ControlToValidate="TextBox4" ErrorMessage="*?" ForeColor="LightCoral" Font-Names="Verdana"
                        Font-Size="Small" ToolTip="This field must contain a valid value." Enabled='<%# Eval("PREditable") %>'></asp:RequiredFieldValidator><asp:RangeValidator
                            ID="rv4" runat="server" ControlToValidate="TextBox4" ErrorMessage="*#" ForeColor="LightCoral" Font-Names="Verdana"
                            Font-Size="Small" MaximumValue="10000" MinimumValue="0" ToolTip="This field must contain a number between 0 and 10000"
                            Type="Double" Enabled='<%# Eval("PREditable") %>'></asp:RangeValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:DropDownList ID="ddNonEditProdRank" runat="server" AutoPostBack="True" DataSourceID="dsProductRankList"
                        DataTextField="ProductRank" DataValueField="ProductRank" Font-Names="Verdana"
                        Font-Size="X-Small" OnSelectedIndexChanged="ddNonEditProdRank_SelectedIndexChanged"
                        SelectedValue='<%# Bind("ProductRank", "{0:F}") %>'>
                    </asp:DropDownList><asp:Label ID="lblMBID" runat="server" Text='<%# Eval("MasterBacklogID") %>'
                        Visible="False"></asp:Label>
                </ItemTemplate>
                <HeaderStyle Wrap="False" />
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Master Rank" SortExpression="MasterRank" Visible="False">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox40" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                        OnPreRender="SetupOnFocus_PreRender"
                        Text='<%# Bind("MasterRank", "{0:F}") %>' ToolTip="The feature or deliverables priority in the master backlog"
                        Width="30px"></asp:TextBox><asp:RequiredFieldValidator ID="rfv40" runat="server"
                            ControlToValidate="TextBox40" ErrorMessage="*?" Font-Names="Verdana" Font-Size="Small"
                            ForeColor="LightCoral" ToolTip="This field must contain a valid value." Enabled='<%# Eval("MREditable") %>'></asp:RequiredFieldValidator><asp:RangeValidator
                                ID="rv40a" runat="server" ControlToValidate="TextBox40" ErrorMessage="*#" Font-Names="Verdana"
                                Font-Size="Small" ForeColor="LightCoral" MaximumValue="10000" MinimumValue="0"
                                ToolTip="This field must contain a number between 0 and 10000" Type="Double" Enabled='<%# Eval("MREditable") %>' Text='<%# Eval("MREditable") %>'></asp:RangeValidator>
                </EditItemTemplate>
                <HeaderStyle Wrap="False" />
                <ItemTemplate><asp:DropDownList ID="ddNonEditMasterRank" runat="server" AutoPostBack="True" DataSourceID="dsMasterRankList"
                        DataTextField="MasterRank" DataValueField="MasterRank" Font-Names="Verdana"
                        Font-Size="X-Small" OnSelectedIndexChanged="ddNonEditMasterRank_SelectedIndexChanged"
                        SelectedValue='<%# Bind("MasterRank", "{0:F}") %>'>
                </asp:DropDownList><asp:Label ID="lblMBID3" runat="server" Text='<%# Eval("MasterBacklogID") %>'
                    Visible="False"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="Time" SortExpression="Estimation">
                <EditItemTemplate>
                    <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Estimation", "{0:F}") %>' Font-Names="Verdana" Font-Size="X-Small" ToolTip="The amount of time to complete the feature or deliverable" Width="30px" OnPreRender="SetupOnFocus_PreRender"></asp:TextBox><asp:RequiredFieldValidator
                        ID="rfv5" runat="server" ControlToValidate="TextBox5" ErrorMessage="*?" ForeColor="LightCoral" Font-Names="Verdana"
                        Font-Size="Small" ToolTip="This field must contain a valid value."></asp:RequiredFieldValidator><asp:RangeValidator
                            ID="rv5" runat="server" ControlToValidate="TextBox5" ErrorMessage="*#" ForeColor="LightCoral" Font-Names="Verdana"
                            Font-Size="Small" MaximumValue="10000" MinimumValue="0" ToolTip="This field must contain a number between 0 and 10000"
                            Type="Double"></asp:RangeValidator>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label ID="Label5" runat="server" Text='<%# Bind("Estimation", "{0:F}") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CheckBoxField DataField="FeatureComplete" HeaderText="Complete?" SortExpression="FeatureComplete" />
            <asp:TemplateField HeaderText="Show in MB?" SortExpression="ShowInMB">
                <EditItemTemplate>
                    <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("ShowInMB") %>' ToolTip="If this is checked, the feature will be displayed in the master backlog. If it is not checked, it is likely already assigned to a sprint." />
                </EditItemTemplate>
                <HeaderStyle Wrap="False" />
                <ItemTemplate>
                    <asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("ShowInMB") %>' Enabled="False"
                        ToolTip="If this is checked, the feature will be displayed in the master backlog. If it is not checked, it is likely already assigned to a sprint." />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="lbCopy" runat="server" CausesValidation="False" ForeColor="Black"
                        OnClick="lbCopy_Click" Text="Copy" ToolTip="Make a duplicate entry of this feature"></asp:LinkButton><br />
                    <asp:LinkButton ID="lbSplit" runat="server" CausesValidation="False" ForeColor="Black"
                        OnClick="lbSplit_Click" Text="Split" ToolTip="Split the feature, dividing the time in half and creating a new feature"></asp:LinkButton><asp:Label
                            ID="lblMBID2" runat="server" Text='<%# Eval("MasterBacklogID") %>' Visible="False"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="True" />
            <asp:TemplateField ShowHeader="False">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" CommandName="Delete"
                        ForeColor="Black" OnClientClick="return confirm('Are you sure you want to delete this record?');"
                        Text="Delete" ToolTip="Delete the feature from the Product Backlog"></asp:LinkButton><br />
                    <br />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle BackColor="#E3EAEB" VerticalAlign="Top" />
        <EditRowStyle BackColor="#7C6F57" HorizontalAlign="Left" VerticalAlign="Top" ForeColor="White" />
        <SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
        <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
        <HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td colspan="4" style="text-align: left; border-right: silver 1px ridge; border-top: silver 1px ridge; border-left: silver 1px ridge;" bgcolor="#e3eaeb">
                    <asp:LinkButton ID="lbReNumProRank" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                        ForeColor="Black" OnClick="lbReNumProRank_Click" ToolTip="Clicking this link will re-number the product rank from 1 to the number of features in the product backlog.">Re-number Product Rank</asp:LinkButton>&nbsp;
                    | <asp:LinkButton ID="lbProdRankFromMasterRank" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                        ForeColor="Black" OnClick="lbProdRankFromMasterRank_Click" ToolTip="Clicking this link will re-number the product rank to the value in the master rank">Update Product Rank From Master Rank</asp:LinkButton>
                    |
                    <asp:LinkButton ID="lbSortFeatureActivity" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                        ForeColor="Black" OnClick="lbSortFeatureActivity_Click" ToolTip="Clicking this link will do a sort by Feature and Activity">Sort by Feature and Activity</asp:LinkButton>
                    |
                    <asp:LinkButton ID="lbSetAllActiveInMB" runat="server" Font-Names="Verdana" Font-Size="X-Small"
                        ForeColor="Black" OnClick="lbSetAllActiveInMB_Click" ToolTip="Clicking this link will set all Active items to show in the Master Backlog">Set all Active to show in Master Backlog</asp:LinkButton></td>
            </tr>
            <tr>
                <td bgcolor="#eeebec" colspan="4" style="border-right: silver 1px ridge; border-top: silver 1px ridge;
                    border-left: silver 1px ridge; border-bottom: silver 1px ridge; text-align: left">
                    <asp:CheckBox ID="chbAutoUpdateProductRank" runat="server" Checked="True" Font-Names="Verdana"
                        Font-Size="X-Small" Text="Auto Product Rank" ToolTip="When this is checked, a change to the Product Backlog rank using the dropdown list will cause an update to all other Product Ranks" AutoPostBack="True" OnCheckedChanged="chbAutoUpdateProductRank_CheckedChanged" />
                    |<asp:CheckBox ID="chbAutoUpdateMasterRank" runat="server" Checked="True" Font-Names="Verdana"
                        Font-Size="X-Small" Text="Auto Master Rank" ToolTip="When this is checked, a change to the Master Backlog rank using the dropdown list will cause an update to all other Master Ranks in this Product" AutoPostBack="True" OnCheckedChanged="chbAutoUpdateMasterRank_CheckedChanged" />
                    |
                    <asp:CheckBox ID="chbShowProductRankCol" runat="server" AutoPostBack="True"
                        Font-Names="Verdana" Font-Size="X-Small" OnCheckedChanged="chbShowProductRankCol_CheckedChanged"
                        Text="Show Product Rank" ToolTip="Show or Hide the Product Rank" />
                    |
                    <asp:CheckBox ID="chbShowMasterRankCol" runat="server" AutoPostBack="True"
                        Font-Names="Verdana" Font-Size="X-Small" OnCheckedChanged="chbShowMasterRankCol_CheckedChanged"
                        Text="Show Master Rank" ToolTip="Show or Hide the Master Backlog Rank" />
                    |
                    <asp:CheckBox ID="chbShowProdInEditMode" runat="server" AutoPostBack="True"
                        Font-Names="Verdana" Font-Size="X-Small" OnCheckedChanged="chbShowProdInEditMode_CheckedChanged"
                        Text="Show Product (Edit Mode)" ToolTip="Show or Hide the Product column when in edit mode. This allows moving a feature from one product to another." />
                    |
                    <asp:CheckBox ID="chbShowCustomerScenario" runat="server" AutoPostBack="True"
                        Font-Names="Verdana" Font-Size="X-Small" OnCheckedChanged="chbShowCustomerScenario_CheckedChanged"
                        Text="Show Customer Scenario" ToolTip="Show or Hide the Customer Scenario information" /></td>
            </tr>
            <tr>
                <td colspan="4">
    <asp:Label ID="lblCantDelete" runat="server" Font-Names="Verdana" Font-Size="X-Small"
        ForeColor="Red" Text="The backlog entry cannot be deleted as associated sprint backlog items exist"
        Visible="False"></asp:Label></td>
            </tr>
        </table>
        </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    </span>
    <asp:SqlDataSource ID="dsBacklogEntry" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        DeleteCommand="DELETE FROM tblMasterBacklog WHERE (MasterBacklogID = @original_MasterBacklogID)"
        OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT tblMasterBacklog.MasterBacklogID, tblMasterBacklog.fProductID, tblMasterBacklog.Feature, tblMasterBacklog.Activity, tblMasterBacklog.Description, tblMasterBacklog.ProductPriority, tblMasterBacklog.Hours * @TimeMult AS Estimation, tblMasterBacklog.FeatureComplete, tblMasterBacklog.ShowInMB, @MREditable AS MREditable, @PREditable as PREditable, @CScenEditable as CScenEditable, tblProducts.ProductName, tblMasterBacklog.ProductRank, tblMasterBacklog.MasterRank, tblMasterBacklog.CustomerScenario FROM tblMasterBacklog INNER JOIN tblProducts ON tblMasterBacklog.fProductID = tblProducts.ProductID WHERE (tblMasterBacklog.fProductID = @fProductID) AND (tblMasterBacklog.FeatureComplete = @FeatureComplete1 OR tblMasterBacklog.FeatureComplete = @FeatureComplete2) ORDER BY tblMasterBacklog.ProductRank, tblMasterBacklog.MasterRank"
        UpdateCommand="UPDATE tblMasterBacklog SET Feature = @Feature, Activity = @Activity, Description = @Description, ProductPriority = @ProductPriority, Hours = @Estimation, FeatureComplete = @FeatureComplete, ShowInMB = @ShowInMB, fProductID = @fProductID, MasterRank = @MasterRank, ProductRank = @ProductRank, CustomerScenario = @CustomerScenario WHERE (MasterBacklogID = @original_MasterBacklogID)" OnUpdating="dsBacklogEntry_Updating" OnDeleting="dsBacklogEntry_Deleting">
        <SelectParameters>
            <asp:SessionParameter Name="TimeMult" SessionField="MBTimeMult" />
            <asp:ControlParameter ControlID="chbShowMasterRankCol" Name="MREditable" PropertyName="Checked" />
            <asp:ControlParameter ControlID="chbShowProductRankCol" Name="PREditable" PropertyName="Checked"/>
            <asp:ControlParameter ControlID="chbShowCustomerScenario" Name="CScenEditable" PropertyName="Checked"/>
            <asp:ControlParameter ControlID="dlProducts" Name="fProductID" PropertyName="SelectedValue"
                Type="Int32" />
            <asp:SessionParameter Name="FeatureComplete1" SessionField="F1" />
            <asp:SessionParameter Name="FeatureComplete2" SessionField="F2" />
        </SelectParameters>
        <DeleteParameters>
            <asp:Parameter Name="original_MasterBacklogID" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Feature" />
            <asp:Parameter Name="Activity" />
            <asp:Parameter Name="Description" />
            <asp:Parameter Name="ProductPriority" />
            <asp:Parameter Name="Estimation" />
            <asp:Parameter Name="FeatureComplete" />
            <asp:Parameter Name="ShowInMB" />
            <asp:Parameter Name="fProductID" />
            <asp:Parameter Name="MasterRank" />
            <asp:Parameter Name="ProductRank" />
            <asp:Parameter Name="CustomerScenario" />
            <asp:Parameter Name="original_MasterBacklogID" />
        </UpdateParameters>
    </asp:SqlDataSource>
        <asp:SqlDataSource ID="dsProducts" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
            SelectCommand="SELECT tblProducts.ProductID, tblProducts.ProductName FROM tblProducts INNER JOIN tblScrumTeam ON tblProducts.fScrumTeamProductListID = tblScrumTeam.ScrumTeamProductListID WHERE (tblScrumTeam.ScrumTeamID = @ScrumTeamID) AND tblProducts.ProductComplete = 0 ORDER BY tblProducts.ProductName">
            <SelectParameters>
                <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
            </SelectParameters>
        </asp:SqlDataSource>
    <asp:SqlDataSource ID="dsMasterRankList" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
        SelectCommand="SELECT DISTINCT tblMasterBacklog.MasterRank FROM tblMasterBacklog INNER JOIN tblProducts ON tblMasterBacklog.fProductID = tblProducts.ProductID INNER JOIN tblScrumTeam ON tblProducts.fScrumTeamProductListID = tblScrumTeam.ScrumTeamProductListID WHERE (tblScrumTeam.ScrumTeamID = @ScrumTeamID) ORDER BY tblMasterBacklog.MasterRank" CacheDuration="1" CacheExpirationPolicy="Sliding" EnableCaching="True">
        <SelectParameters>
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="dsProductRankList" runat="server" ConnectionString="<%$ ConnectionStrings:TackleConnectionStringMain %>"
        ProviderName="<%$ ConnectionStrings:TackleConnectionStringMain.ProviderName %>"
        SelectCommand="SELECT DISTINCT ProductRank FROM tblMasterBacklog WHERE (fProductID = @ProductID) ORDER BY ProductRank" CacheDuration="1" CacheExpirationPolicy="Sliding" EnableCaching="True">
        <SelectParameters>
            <asp:ControlParameter ControlID="dlProducts" Name="ProductID" PropertyName="SelectedValue" />
            <asp:SessionParameter Name="ScrumTeamID" SessionField="ScrumTeamID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>

